package com.wanshi.utils;

import com.wanshi.po.Record;
import com.wanshi.service.RecordService;

public class AsynOprDatabaseUtil implements Runnable{


    private RecordService recordService;

    private Record record;

    private boolean flag;

    private String uuid;

    public AsynOprDatabaseUtil(RecordService recordService, Record record, boolean flag,String uuid){
        this.recordService = recordService;
        this.record = record;
        this.flag =flag;
        this.uuid=uuid;
    }

    @Override
    public void run() {
        DaTiUtils.deleteFile(uuid);
        if (flag) {
            record.setResult(1);
        } else {
            record.setResult(0);
        }
        recordService.addRecord(record);
    }
}
